import {
  createRouter,
  createWebHistory
} from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(
    import.meta.env.BASE_URL),
  routes: [{
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/community',
      name: 'community', // 添加路由名称
      component: () => import('@/views/CommunityView.vue')
    },
    {
      path: '/profile',
      name: 'profile',
      component: () => import('@/views/Profile.vue')
    },
    {
      path:'/PostEditor',
      name:'PostEditor',
      component:()=>import('@/views/PostEditor.vue'), // Add this comma
      meta: { isEditorPage: true }
    },
    {
      path:'/PostDetail/:id',
      name:'PostDetail',
      component:()=>import('@/views/PostDetail.vue'),
    },
    {
      path:"/searchDetail",
      name:'searchDetail',
      component:() => import('@/views/SearchDetail.vue')
    }
  ],
})

export default router